package md.lanjing.com.module_deal_center.contact;

import android.content.Context;

import com.lxh.baselibray.mvp.BasePresent;
import com.lxh.baselibray.mvp.IBaseView;
import com.lxh.baselibray.net.NetCallBack;
import com.lxh.baselibray.net.ServiceGenerator;
import com.lxh.baselibray.util.ToastUtils;


import md.lanjing.com.module_deal_center.api.DealApiService;
import md.lanjing.com.module_deal_center.bean.PayMoneyRespoce;
import retrofit2.Call;
import retrofit2.Response;

public class PayMoneyContact {
    public static class PayMoneyPresent extends BasePresent<IPayMoneyView> {
        public void queryPayMoneyMsg(final Context context, String transferId){
            DealApiService service= ServiceGenerator.createService(DealApiService.class);
            service.queryPayMoneyMsg(transferId).enqueue(new NetCallBack<PayMoneyRespoce>() {
                @Override
                public void onSuccess(Call<PayMoneyRespoce> call, Response<PayMoneyRespoce> response) {
                    if (getView()!=null){
                        getView().getPayMoneyMsgData( response);
                    }
                }

                @Override
                public void onFailed() {
                    ToastUtils.showLongToast(context,"网络请求异常");
                }
            });
        }
    }
    public interface IPayMoneyView extends IBaseView {
        void getPayMoneyMsgData(Response<PayMoneyRespoce> response);
    }
}
